home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / archivesinkadmin.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  7.6 KB  |  259 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <%
  9. '+-------------------------------------------------------------------------
  10. '
  11. '  Microsoft Windows Media
  12. '  Copyright (C) Microsoft Corporation. All rights reserved.
  13. '
  14. '  File:       ArchiveSinkAdmin.asp
  15. '
  16. '  Contents:
  17. '
  18. '--------------------------------------------------------------------------
  19.  
  20. ConnectToPlugin
  21. ConnectToPluginAdmin
  22.  
  23. BeginErrorHandling
  24.  
  25. Dim bError
  26. Dim strPath
  27. Dim bAutoStart
  28. Dim dwTabIndex
  29.  
  30. dwTabIndex = 0
  31.  
  32. bError = FALSE
  33.  
  34. Dim strOp
  35. strOp = trim( posting( "submit" ) )
  36. if( 0 < Len( strOp ) ) then
  37.  
  38.     on error resume next
  39.  
  40.     if ( 0 < Len( CStr( posting("autoStart") ) ) ) then
  41.         if( FALSE = CBool( g_objPluginAdmin.AutoStart ) ) then
  42.             g_objPluginAdmin.AutoStart = TRUE
  43.         end if
  44.     else
  45.         if( CBool( g_objPluginAdmin.AutoStart ) ) then
  46.             g_objPluginAdmin.AutoStart = FALSE
  47.         end if
  48.     end if
  49.             
  50.     if ErrorDetected( "autoStart" ) then
  51.         bError = TRUE
  52.     end if
  53.  
  54.     Dim strOldArchPath
  55.     Dim strNewArchPath
  56.  
  57.     strOldArchPath = CStr( g_objPluginAdmin.Path )
  58.     strNewArchPath = GetSafePath
  59.     
  60.     if( FALSE = bError ) then
  61.         if ( 0 < Len( strNewArchPath ) ) and ( 0 <> StrComp( strNewArchPath, strOldArchPath, vbTextCompare ) ) then
  62.             if( MAX_PATH >= Len( strNewArchPath ) ) then
  63.                 g_objPluginAdmin.Path = strNewArchPath
  64.             end if
  65.             if ErrorDetected( "Path" ) then
  66.                 bError = TRUE
  67.             end if
  68.         end if    
  69.     else
  70.         Session( "PageReloadedToDisplayError" ) = 1
  71.         err.Description = CStr( Server.HTMLEncode( L_INVALIDPATHNAME_TEXT ) )
  72.     end if
  73.     
  74.     if( FALSE = bError ) then
  75.         Response.Redirect "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex")
  76.     end if
  77.  
  78. end if
  79.  
  80. if( "" <> CStr( posting("autoStart") ) ) then
  81.     bAutoStart = TRUE
  82. else
  83.     bAutoStart = g_objPluginAdmin.AutoStart
  84. end if
  85.  
  86. if( "" <> posting("archivePath") ) then
  87.     strPath = CStr( posting("archivePath") )
  88. else
  89.     strPath = g_objPluginAdmin.Path
  90. end if
  91.  
  92. '//////////////////////////////////////////////////////////////////////////
  93. Function GetSafePath()
  94.     Dim strPath
  95.     strPath = trim( posting("archivePath") )
  96.     GetSafePath = RemoveSpecifiedChars( strPath, ";|\f|\n|\r|`" )
  97. End Function
  98.  
  99. WriteHTMLHeader( g_strDecodedServerName ) 
  100. %>
  101. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  102. <% WritePluginJSUtils %>
  103. <script language="javascript">
  104. <!--
  105. /*@cc_on @*/
  106.  
  107. //////////////////////////////////////////////////////////////////////////
  108. function ValidatePath()
  109. {
  110.     <% jsTRY %>
  111.         if( ! document.forms.pluginForm.archivePath )
  112.         {
  113.             return;
  114.         }
  115.         
  116.         var szPath;
  117.         szPath = new String( document.forms.pluginForm.archivePath.value );
  118.         
  119.         // perform left trim
  120.         szPath = szPath.replace( /^\s+/, "" );
  121.  
  122.         // perform right trim
  123.         szPath = szPath.replace( /\s+$/, "" );
  124.  
  125.         window.status="check";
  126.         var szPathFiltered = szPath.replace( /\`|\'|!|@|#|\^|\&|\||{|}|;|\?|\"/g, "" );
  127.         if( szPathFiltered != szPath )
  128.         {
  129.             document.forms.pluginForm.ok.disabled = true;
  130.             document.forms.pluginForm.archivePath.style.color="#FF0000";
  131.             return;
  132.         }
  133.         
  134.         if( 0 >= szPath.length )
  135.         {
  136.             document.forms.pluginForm.ok.disabled = true;
  137.         }
  138.         else
  139.         {
  140.             document.forms.pluginForm.ok.disabled = false;
  141.             document.forms.pluginForm.archivePath.style.color="#000000";
  142.         }
  143.         document.forms.pluginForm.archivePath.focus();
  144.     <% jsCATCH %>
  145. }
  146.  
  147. //////////////////////////////////////////////////////////////////////////
  148. function ToggleCheckbox()
  149. {
  150.     <% jsTRY %>
  151.         if( document.forms.pluginForm.autoStart )
  152.         {
  153.             document.forms.pluginForm.autoStart.checked = ! document.forms.pluginForm.autoStart.checked;
  154.         }
  155.         
  156.         if( document.forms.pluginForm.ok )
  157.         {
  158.             document.forms.pluginForm.ok.disabled = false;
  159.         }
  160.     <% jsCATCH %>
  161. }
  162. -->
  163. </script>
  164. </head>
  165. <body onLoad="JavaScript:ValidatePath();" class="pluginBody" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  166. <% DrawPluginBanner %>
  167. <table width="90%">
  168. <tr>
  169.     <td valign=top>
  170.  
  171.         <% WriteStdPluginForm %>
  172.  
  173.         <table class="propgroupbox" border=0 cellspacing=2 cellpadding=2 width=100%>
  174.         <tr>
  175.           <td colspan=3>
  176.             <div align="left" class="helptext"><%= Server.HTMLEncode( L_ARCHIVEPATHHELP_TEXT ) %></div><br>
  177.           </td>
  178.         </tr>
  179.         <tr>
  180.           <td>
  181.                 <input type="checkbox"
  182.                     name="autoStart" <% if bAutoStart then %>checked<% end if %> 
  183.                     value="autoStart"
  184.                     tabindex=1
  185.                     ><label for="autoStart" class="handcursor" onClick="JavaScript:ToggleCheckbox();"><span nowrap><% RenderWithErrorCheck Server.HTMLEncode( L_AUTOSTARTARCH_TEXT ), "autoStart" %></span></label>
  186.             <p>
  187.                 
  188.             <% RenderWithErrorCheck Server.HTMLEncode( L_FILENAMECOLON_TEXT ), "Path" %></div>
  189.             <input 
  190.                 type="text" 
  191.                 name="archivePath" 
  192.                 size="75"
  193.                 maxlength=<%= Server.HTMLEncode( MAX_PATH ) %>"
  194.                 tabindex=2
  195.                 onChange="JavaScript:ValidatePath();"
  196.                 onPaste="JavaScript:ValidatePath();"
  197.                 onKeyDown="JavaScript:ValidatePath();"
  198.                 onKeyUp="JavaScript:ValidatePath();"
  199.                 value="<%= Server.HTMLEncode( strPath ) %>"
  200.                 >
  201.         </td>
  202.       </tr>
  203.       </table>
  204.   </td>
  205. </tr>
  206. <tr>
  207.     <td>
  208.          <br>
  209.         <table class="defaultcursor" width="100%" cellspacing="2" cellpadding="2" border="1" cols="3" bgcolor="#F5F5F5">
  210.         <tr>
  211.             <td align="left">
  212.                 <table class="defaultcursor" width="100%" cellspacing="2" cellpadding="2" border="0" cols="3">
  213.                 <tr>
  214.                     <td align="left" width="32">
  215.                         <img src="img/wmstip_32.gif" height="32" width="32">
  216.                     </td>
  217.                     <td align="left">
  218.                         <span class="helptext"><%= Server.HTMLEncode( L_LOCALSTORAGEWARN_TEXT ) %></span>
  219.                     </td>
  220.                     <td align="right">
  221.                          
  222.                     </td>
  223.                 </tr>
  224.                 </table>
  225.             </td>
  226.         </tr>
  227.         </table>
  228.     </td>
  229. </tr>
  230. <tr>
  231.     <td valign=bottom>
  232.         <br>
  233.         <input type="submit" disabled align="baseline" name="ok" value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" tabIndex=3> 
  234.         <input type="button" align="baseline" name="cancel" onclick="Cancel()" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>" tabIndex=4 > 
  235.         <input type="button" align="baseline" name="help" onclick="JavaScript:DoPluginHelp( '<%= H_ARCHIVERHELPTOPIC %>' )" value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>" id="help" tabindex=5>
  236.     </td>
  237. </tr>
  238. </table>
  239. </font>
  240. <% dwTabIndex = 5 %>
  241. </form>
  242. <script language="JavaScript">
  243.     document.pluginForm.archivePath.focus();
  244. </script>
  245. <% 
  246. AlertUserWithPopupErrorDialog
  247. OnErrorGoBack 
  248. DrawStdFooter
  249. %>
  250. </body>
  251. </html>
  252. <% 
  253. LatchCurrentPage "plugins/ArchiveSinkAdmin.asp", qs
  254. EndErrorHandling "ArchiveSinkAdmin.asp" 
  255.  
  256. on error resume next
  257. PluginsASPCleanup
  258. %>
  259.